package com.shengwei.truck.driver.vm;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.shengwei.truck.driver.bean.JsonCurUserInfoData;
import com.shengwei.truck.driver.bean.Result;

/**
 * 首页底部"我的"TAB页的VM层，调用M层去获取数据，同时更改liveData的数据，从而View层（LoginActivity)就能观察到LiveData数据的
 * 变化，最后更新UI。
 */
public class MineViewModel extends BaseHistoryViewModel {
    private MutableLiveData<String> mText;
    private MutableLiveData<Result<JsonCurUserInfoData>> mCurUserInfo = new MutableLiveData<>();

    public MineViewModel() {
        super();
    }
    public MutableLiveData<Result<JsonCurUserInfoData>> getCurUserInfo() {
        return mCurUserInfo;
    }
    public LiveData<String> getText() {
        return mText;
    }

    /**
     * 获取当前登录用户信息
     * @return
     */
    public void getUserInfo() {
        mRepository.getUserInfo(mCurUserInfo);
    }
}